package com.sample.generator.context.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sample.generator.config.WriterConfig;
import com.sample.generator.context.GenerationContext;

public class DefaultGeneratorContext implements GenerationContext {

	private Map<String, Object> contextMap = new HashMap<String, Object>();

	private List<WriterConfig> writerConfigs = new ArrayList<WriterConfig>();

	public void put(String key, Object value) {

		contextMap.put(key, value);
	}

	public void putAll(Map<String, Object> t) {

		contextMap.putAll(t);
	}

	public void addWriterConfig(WriterConfig writerConfig) {

		if (writerConfig == null) {
			throw new IllegalArgumentException("Argument writerConfig is null.");
		}
		writerConfigs.add(writerConfig);
	}

	public Map<String, Object> getContextMap() {

		return contextMap;
	}

	public List<WriterConfig> getWriterConfigs() {

		return writerConfigs;
	}
}
